package com.zytool.easyrestful.core.utils;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

public class HttpRequestUtil {

    public static Map<String, String> getRequestMap(HttpServletRequest request) {
        Enumeration<String> enumeration = request.getParameterNames();
        Map<String, String> paramMap = new HashMap<>();
        while (enumeration.hasMoreElements()) {
            String paramName = enumeration.nextElement();
            paramMap.put(paramName, request.getParameter(paramName));
        }
        return paramMap;
    }
}
